package com.mosai.alignpro.view;

import android.content.Context;
import androidx.recyclerview.widget.LinearLayoutManager;

/**
 * Created by Rays on 2020/3/9.
 */
public class MyLinearLayoutManager extends LinearLayoutManager {
    private boolean interceptScroll = false;

    public MyLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
        super(context, orientation, reverseLayout);
    }

    @Override
    public boolean canScrollVertically() {
        return !interceptScroll && super.canScrollVertically();
    }

    @Override
    public boolean canScrollHorizontally() {
        return !interceptScroll && super.canScrollHorizontally();
    }

    public void setInterceptScroll(boolean interceptScroll) {
        this.interceptScroll = interceptScroll;
    }
}
